package com.monkey.core.plugin.report.excel;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Excel数据对象
 */
public class ExcelData {

    private String downloadFileName;
    private String templatePath;
    /**
     * Excel参数元数据对象
     */
    private Map parameters = new HashMap();

    private Map variables = new HashMap();

    /**
     * Excel集合元对象
     */
    private List fields = new ArrayList<>();

    public ExcelData() {
    }

    /**
     * 构造函数
     *
     * @param parameters 元参数对象
     * @param pList      集合元对象
     */
    public ExcelData(Map parameters, Map variables, List pList) {
        setParameters(parameters);
        setFields(pList);
        setVariables(variables);
    }

    @SuppressWarnings("unchecked")
    public ExcelData addField(Object value) {
        this.fields.add(value);
        return this;
    }

    @SuppressWarnings("unchecked")
    public ExcelData addParameter(String key, Object value) {
        this.parameters.put(key, value);
        return this;
    }

    @SuppressWarnings("unchecked")
    public ExcelData addVariable(String key, Object value) {
        this.variables.put(key, value);
        return this;
    }

    public String getDownloadFileName() {
        return downloadFileName;
    }

    public void setDownloadFileName(String downloadFileName) {
        this.downloadFileName = downloadFileName;
    }

    public Map getParameters() {
        return parameters;
    }

    public void setParameters(Map parameters) {
        this.parameters = parameters;
    }

    public Map getVariables() {
        return variables;
    }

    public void setVariables(Map variables) {
        this.variables = variables;
    }

    public List getFields() {
        return fields;
    }

    public void setFields(List fields) {
        this.fields = fields;
    }

    public String getTemplatePath() {
        return templatePath;
    }

    public void setTemplatePath(String templatePath) {
        this.templatePath = templatePath;
    }
}
